Carbon


PBGetCatInfoSync

Header: Files.h Carbon status: Supported

Gets information about the files and directories in a file catalog.

OSErr PBGetCatInfoSync (
    CInfoPBPtr paramBlock
);
paramBlock

A pointer to a catalog information parameter block.

function result

A result code.

DISCUSSION

The PBGetCatInfoSync function returns information about a file or directory, depending on the values you specify in the ioFDirIndex, ioNamePtr, ioVRefNum, and ioDirID or ioDrDirID fields. If you need to determine whether the information returned is for a file or a directory, you can test bit 4 of the ioFlAttrib field; if that bit is set, the information returned describes a directory.

The PBGetCatInfoSync function selects a file or directory according to these rules:

The fields of the parameter block which are used by both files and directories are:

These bits in the ioFlAttrib field for directories are read-only. You cannot alter directory attributes by setting these bits using PBSetCatInfoSync. Instead, you can call PBHSetFLockSync and PBHRstFLockSync to lock and unlock a directory, and PBShareSync and PBUnshareSync to enable and disable file sharing on local directories.

For files, these fields of the parameter block are also used:

For directories, these fields of the parameter block are also used:

With files, PBGetCatInfoSync is similar to PBHGetFInfoSync but returns some additional information. With directories, PBGetCatInfoSync returns information such as the directory attributes and, for server volumes, the directory access privileges of the user.

You can also use PBGetCatInfoSync to determine whether a file has a file ID reference. The value of the file ID is returned in the ioDirID field. Because that parameter could also represent a directory ID, call PBResolveFileIDRefSync to see if the value is a real file ID. If you want to determine whether a file ID reference exists for a file and create one if it doesn’t, use PBCreateFileIDRefSync, which will either create a file ID or return fidExists.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)